<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue</title>
</head>
<body>
    <div id="app" >
      <form v-on:submit.prevent="handleSubmit">
        <label>用户名</label>
        <input/>
        <input type="submit"/>
      </form>
    </div>
    <script src="vue.js"></script>
    <script>
        var vm = new Vue({
            el:'#app',
            data:{msg:'hello'},
            methods:{//定义此Vue实例的方法
                handleSubmit(event){
                    //event.preventDefault();
                    console.log('handleSubmit');
                }
            }
        });
    </script>
</body>
</html>